/**
 * Created by WYH on 17/2/24.
 */

/* 判断浏览器 */
var JudgeBrowser = (function () {
    var userAgent = navigator.userAgent;


    function isOpera() {
        return userAgent.indexOf("Opera") > -1;
    }

    function isIE() {
        return "ActiveXObject" in window;
    }

    function isFirefox() {
        return userAgent.indexOf("Firefox") > -1 ;
    }

    function isMaxthon() {
        return userAgent.indexOf("Maxthon") > -1 ;
    }

    function isSafari() {
        return userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") < 1 ;
    }

    function isChrome() {
        return userAgent.indexOf("Chrome") > -1 ;
    }

    function  isEdge() {
        return userAgent.indexOf("Edge") > -1;
    }

    function changeTopBarTextSizeInIE() {
        if (isIE() || isEdge()) {
            $(".top_tab_info p").addClass('is_ie');
        }
    }


    return {
        isIE: isIE,
        isOpera:isOpera,
        isFirefox: isFirefox,
        isMaxthon: isMaxthon,
        isSafari: isSafari,
        isChrome: isChrome,
        isEdge: isEdge,
        changeTopBarTextSizeInIE: changeTopBarTextSizeInIE
    }

})();